﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SelectController : MonoBehaviour
{
    public UIScrollBar Select;
    public UILabel all;
    public UISprite wuqi;
    public UISprite dun;
    public UISprite xie;
    public UISprite jiez;
    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (Select.value==0)
        {
            all.color= Color.yellow;
        }
        else if (Select.value!=0)
        {
            all.color = Color.white;
        }
        if (Select.value==0.25f)
        {
            wuqi.spriteName = "tab_icon_0_focus";
        }
        else if (Select.value!=0.25f)
        {
            wuqi.spriteName = "tab_icon_0_normal";
        }
        if (Select.value == 0.5f)
        {
            dun.spriteName = "tab_icon_1_focus";
        }
        else if (Select.value != 0.5f)
        {
            dun.spriteName = "tab_icon_1_normal";
        }
        if (Select.value == 0.75f)
        {
            xie.spriteName = "tab_icon_2_focus";
        }
        else if (Select.value != 0.75f)
        {
            xie.spriteName = "tab_icon_2_normal";
        }
        if (Select.value == 1f)
        {
            jiez.spriteName = "tab_icon_3_focus";
        }
        else if (Select.value != 1f)
        {
            jiez.spriteName = "tab_icon_3_normal";
        }
    }



    public void OnClick()
    {
        Select.value = 0;
    }
    public void OnClick1()
    {
        Select.value = 0.25f;
    }
    public void OnClick2()
    {
        Select.value = 0.5f;
    }
    public void OnClick3()
    {
        Select.value = 0.75f;
    }
    public void OnClick4()
    {
        Select.value = 1f;
    }
}
